package cn.net.trimmer.servlet.demo1.dao.impl;

import cn.net.trimmer.servlet.demo1.dao.UserDao;
import cn.net.trimmer.servlet.demo1.dao.UserRowMapper;
import cn.net.trimmer.servlet.demo1.entity.User;
import cn.net.trimmer.servlet.demo1.util.JdbcTemplate;

public class UserDaoImpl implements UserDao {
	// 创建jdbc模板
	private JdbcTemplate<User> tmp = new JdbcTemplate<User>();

	@Override
	public User queryByUsernameAndPassword(String username, String password) {
		return tmp.queryOne("select id,name,password,sex,birthday from t_user where name = ? and password = ?", new UserRowMapper(),username,password);
	}

}
